<html>
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<title>show hacker info</title>
		<link rel="stylesheet" type="text/css" href="static/css/bootstrap.min.css"/>
        <link rel="stylesheet" type="text/css" href="static/css/dataTables.bootstrap.min.css">
		<script type="text/javascript" src="static/js/datatables.min.js"></script>
<!--		<script type="text/javascript" charset="utf-8">-->
<!--			$(document).ready(function() {-->
<!--				$('#example').DataTable();-->
<!--			} );-->
<!--		</script>-->
	</head>
	<body>
		<div class="container">
            <table id="example" class="table table-striped table-bordered" style="width:100%">
                <thead>
                    <tr>
                        <th>IP</th>
                        <th>Wechat Id</th>
                        <th>QR Code</th>
                    </tr>
                </thead>
                <tbody>
                    {% for i in hackInfo %}
                        <tr class="text-center">
                            <td>{{ i[0] }}</td>
                            <td><input name="wechatId" value="{{ i[1] }}" type="hidden">{{ i[1] }}</td>
                            <td id="qrcode"></td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
		</div>
	</body>
    <script type="text/javascript" src="static/js/qrcode.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $('#example').DataTable();
            $("#example tbody>tr").click(function() {
                var trSeq = $(this).parent().find("tr").index($(this)[0]); //所获取的当前行的行号
                var getid = $("#example tbody>tr").eq(trSeq).find("input[name='wechatId']").val();
                var src = "weixin://contacts/profile/" + getid;
                $("#qrcode").html('');
                new QRCode(document.getElementById("qrcode"), src);
            });
        });
    </script>
</html>